package com.restcloud.pojo.Public;

import lombok.Data;

import javax.xml.bind.annotation.*;
import java.io.Serializable;
import java.util.List;

@XmlAccessorType(XmlAccessType.FIELD)
@Data
public class Code implements Serializable {
    public Code() {
    }

    public Code(List<Code> displayName) {
        this.qualifier = displayName;
    }

    public Code(String code) {
        this.code = code;
    }

    public Code(String code, String codeSystem) {
        this.code = code;
        this.codeSystem = codeSystem;
    }

    public Code(String code, String codeSystem, String codeSystemName) {
        this.code = code;
        this.codeSystem = codeSystem;
        this.codeSystemName = codeSystemName;
    }

    public Code(String code, String displayName, String codeSystem, String codeSystemName) {
        this.code = code;
        this.displayNameAttr = displayName;
        this.codeSystem = codeSystem;
        this.codeSystemName = codeSystemName;
    }

    public Code(String type, String code, String codeSystem, String codeSystemName, String displayName) {
        this.type = type;
        this.code = code;
        this.codeSystem = codeSystem;
        this.codeSystemName = codeSystemName;
        this.displayNameAttr = displayName;
    }

    public Code(Value low, Value high) {
        this.low = low;
        this.high = high;
    }

    @XmlAttribute(name = "xsi:type")
    private String type;

    @XmlAttribute(name = "code")
    private String code;

    @XmlAttribute(name = "displayName")
    private String displayNameAttr;

    @XmlAttribute(name = "codeSystem")
    private String codeSystem;

    @XmlAttribute(name = "codeSystemName")
    private String codeSystemName;

    @XmlElement(name = "low")
    private Value low;

    @XmlElement(name = "high")
    private Value high;

    @XmlElement(name = "displayName")
    private Value displayName;

    @XmlElementWrapper(name = "qualifier")
    @XmlElement(name = "name")
    private List<Code> qualifier;

    private String text;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDisplayNameAttr() {
        return displayNameAttr;
    }

    public void setDisplayNameAttr(String displayNameAttr) {
        this.displayNameAttr = displayNameAttr;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCodeSystem() {
        return codeSystem;
    }

    public void setCodeSystem(String codeSystem) {
        this.codeSystem = codeSystem;
    }

    public String getCodeSystemName() {
        return codeSystemName;
    }

    public void setCodeSystemName(String codeSystemName) {
        this.codeSystemName = codeSystemName;
    }

    public Value getLow() {
        return low;
    }

    public void setLow(Value low) {
        this.low = low;
    }

    public Value getHigh() {
        return high;
    }

    public void setHigh(Value high) {
        this.high = high;
    }

    public Value getDisplayName() {
        return displayName;
    }

    public void setDisplayName(Value displayName) {
        this.displayName = displayName;
    }
}
